home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / Tool Chest / Communications Toolbox / CTB Development Resources / Simple FT Tool / Simon Tool / FVAL.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-05-11  |  3.7 KB  |  149 lines  |  [TEXT/MPS ]

  1. /************************************************************************************
  2.                                   P R O J E C T   I N F O
  3. *************************************************************************************
  4.   
  5.     Project Name:    Simon
  6.        File Name:    FVAL.c
  7.   
  8.      Description:    Contains C code specific to the validation code resource
  9.                      of a simple file transfer tool.
  10.   
  11.                           Copyright © 1992 Apple Computer, Inc.
  12.                           All rights reserved.
  13.   
  14. *************************************************************************************
  15.                               A U T H O R   I D E N T I T Y
  16. *************************************************************************************
  17.   
  18.       Initials    Name
  19.       --------    -----------------------------------------------
  20.       CH            Craig Hotchkiss
  21.   
  22. *************************************************************************************
  23.                               R E V I S I O N   H I S T O R Y
  24. *************************************************************************************
  25.  
  26.     Change History (most recent first):
  27.  
  28.          <0>      5/8/92    CH        Creation date
  29.  
  30. ************************************************************************************/
  31.  
  32.  
  33.  
  34. /************************************************************************************
  35.                                 STANDARD Mac HEADERS 
  36. ************************************************************************************/
  37.  
  38. #ifdef DUMPFILENAME
  39.     #pragma load DUMPFILENAME
  40. #else
  41.     #define    DoNotDump     1
  42.     #include Load.c
  43. #endif
  44.  
  45.  
  46.  
  47. /************************************************************************************
  48.                                 Other dependent HEADERs
  49. ************************************************************************************/
  50.  
  51. #ifndef __VALIDATION__
  52.     #include "Validation.h"
  53. #endif
  54.  
  55.  
  56.  
  57. /************************************************************************************
  58. ************************************************************************************/
  59.  
  60. /************************************************************************************
  61.      Procedure:    FVAL
  62.  
  63.      Purpose:    
  64.  
  65.      Inputs:        
  66.  
  67.      Outputs:
  68. ************************************************************************************/
  69. pascal        long        FVAL( FTHandle toolHandle, short message, 
  70.                                 long p1, long p2, long p3 )
  71. {
  72.     long            retValue = ftNotSupported;
  73.     #if Debugging == 1
  74.         #if DefaultDebug == 1
  75.             Str255            tempString;
  76.         #endif
  77.     #endif
  78.     
  79.  
  80. #pragma unused ( p1, p2, p3 )
  81.  
  82.     (**toolHandle).errCode = noErr;
  83.     
  84.     switch ( message ) {
  85.         case ftValidateMsg:
  86.                 /*        *********************
  87.                         Parameter Definitions
  88.                         *********************
  89.                     p1:        Unused
  90.                     p2:        Unused
  91.                     p3:        Unused
  92.                     returns:    Boolean true if validation failed
  93.                 */
  94.                 
  95.             #if Debugging == 1
  96.                 #if ShowMessage == 1
  97.                     DebugStr( "\p FVAL/ftValidateMsg received.;g" );
  98.                 #endif
  99.             #endif
  100.             
  101.             if ( noErr == ( retValue = DoToolValidate( toolHandle ) ) ) {
  102.                 retValue = (long) false;
  103.             } else {
  104.                 retValue = (long) true;
  105.             }
  106.             
  107.             break;
  108.             
  109.         case ftDefaultMsg:
  110.                 /*        *********************
  111.                         Parameter Definitions
  112.                         *********************
  113.                     p1:        Ptr                    configRecordPtr - gets changed
  114.                     p2:        Boolean                allocate
  115.                     p3:        short                procID - tools refNum
  116.                     returns:    nothing
  117.                 */
  118.                 
  119.             #if Debugging == 1
  120.                 #if ShowMessage == 1
  121.                     DebugStr( "\p FVAL/ftValidateMsg received.;g" );
  122.                 #endif
  123.             #endif
  124.             
  125.             if ( noErr == ( retValue = DoToolDefault(    (Ptr*) p1, 
  126.                                                         (Boolean) p2, 
  127.                                                         (short) p3 ) ) ) {
  128.                 retValue = (long) false;
  129.             } else {
  130.                 retValue = (long) true;
  131.             }
  132.             
  133.             break;
  134.             
  135.         default:
  136.             #if Debugging == 1
  137.                 #if DefaultDebug == 1
  138.                     DebugStr( "\p FVAL - Did not understand message -- ;g" );
  139.                     NumToString( (long) message, tempString );
  140.                     DebugStr( tempString );
  141.                 #endif
  142.             #endif
  143.             
  144.             break;
  145.     } /* message switch */
  146.     
  147.     return ( retValue );
  148. } /*FVAL*/
  149.